<?php
require_once PATH_SITE.'cn/royan/php/utils/writers/WriterRoomSimple.writer.php';
require_once PATH_SITE.'cn/royan/php/utils/writers/AbstractWriter.abstract.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of WriterRoomList
 *
 * @author yanr
 */
class WriterRoomList extends AbstractWriter
{
    //put your code here
    public function __construct( $area )
    {
        $this->object = $area;
    }
    
    public function write()
    {
        $rooms = array();
        $list = $this->object->__get("rooms");
        FOR( $i = 0; $i < count( $list ); $i++ )
        {
            IF( $list[$i]->__get("visible") === TRUE )
            {
                $writerRoomSimple = new WriterRoomSimple( $list[$i] );
                array_push( $rooms, $writerRoomSimple->write() );
            }
        }
        RETURN $rooms;
    }
}

?>
